-
Notifications
You must be signed in to change notification settings - Fork 0
Develop #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #15
Conversation
Introduces camera/video recording support using Emgu.CV and ReactiveUI, enabling borrowers to record and upload collateral videos for debts. Adds new services (CameraService, ICameraService), view models (VideoRecorderViewModel), and views (VideoRecorderWindow, VideoPlayerWindow, KeyEntryWindow) for video capture and playback. DebtModel and DebtDto are updated to support video metadata. DebtViewModel now supports video upload, marking debts as defaulted, and secure video viewing for lenders. Filtering and charting improvements are added to Account, Budget, and Transactions view models. Updates dependencies in the project file to support new features.
Removed unused and redundant using statements across multiple files and reordered some for consistency. This improves code readability and reduces unnecessary dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request introduces comprehensive video recording and debt management capabilities to the FinTrack application. The main purpose is to enable borrowers to record guarantee videos using their camera and allow lenders to view these videos when debts are defaulted.
Key changes include:
- Implementation of camera/video recording service with OpenCV integration for capturing and recording videos directly in the application
- Enhancement of debt management workflow with video evidence support and new status-based UI controls
- Addition of video streaming capabilities and debt defaulting functionality through new API endpoints
Reviewed Changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| VideoRecorderWindow.xaml/.cs | New video recording interface with camera preview and commitment text display |
| VideoPlayerWindow.xaml/.cs | New video playback window with automatic cleanup of temporary files |
| VideoRecorderViewModel.cs | ViewModel managing camera operations, recording state, and file handling |
| KeyEntryWindow.xaml/.cs | New dialog for entering encryption keys to access guarantee videos |
| DebtView.xaml | Updated UI with new buttons for marking debts as defaulted and viewing guarantee videos |
| DebtViewModel.cs | Enhanced with camera service integration and video upload/viewing logic |
| DebtModel.cs | Added video metadata support and computed properties for UI visibility |
| CameraService.cs/ICameraService.cs | New service implementing camera capture and video recording using Emgu.CV |
| DebtStore.cs/IDebtStore.cs | Extended with methods for marking debts as defaulted and streaming videos |
| ApiService.cs/IApiService.cs | Added file streaming capabilities for video content |
| TransactionsView.xaml | Enhanced with advanced filtering options and chart visualizations |
| TransactionsViewModel.cs | Major refactoring to support filtering and LiveCharts integration |
| BudgetView.xaml/BudgetViewModel.cs | Added filtering capabilities for budget management |
| AccountView.xaml/AccountViewModel.cs | Added filtering options for account listings |
|
|
||
| if (!_cameraService.InitializeCamera()) | ||
| { | ||
| // TODO: Show a user-friendly error message. |
Copilot
AI
Aug 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace the TODO comment with actual error handling. Consider showing a MessageBox or setting an error property to inform the user why camera initialization failed.
| // TODO: Show a user-friendly error message. | |
| MessageBox.Show("Kamera başlatılamadı. Lütfen kameranın bağlı ve başka bir uygulama tarafından kullanılmadığından emin olun.", "Kamera Hatası", MessageBoxButton.OK, MessageBoxImage.Error); |
| Console.WriteLine($"Temporary video file deleted successfully: {_tempVideoPath}"); | ||
| } | ||
| catch (Exception ex) | ||
| { | ||
| Console.WriteLine($"Could not delete temporary video file: {_tempVideoPath}. Error: {ex.Message}"); |
Copilot
AI
Aug 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace Console.WriteLine with proper logging using ILogger. Console output may not be visible in production WPF applications and doesn't follow the project's logging patterns.
| Console.WriteLine($"Temporary video file deleted successfully: {_tempVideoPath}"); | |
| } | |
| catch (Exception ex) | |
| { | |
| Console.WriteLine($"Could not delete temporary video file: {_tempVideoPath}. Error: {ex.Message}"); | |
| _logger.LogInformation("Temporary video file deleted successfully: {TempVideoPath}", _tempVideoPath); | |
| } | |
| catch (Exception ex) | |
| { | |
| _logger.LogError(ex, "Could not delete temporary video file: {TempVideoPath}. Error: {ErrorMessage}", _tempVideoPath, ex.Message); |
| Console.WriteLine($"Temporary video file deleted successfully: {_tempVideoPath}"); | ||
| } | ||
| catch (Exception ex) | ||
| { | ||
| Console.WriteLine($"Could not delete temporary video file: {_tempVideoPath}. Error: {ex.Message}"); |
Copilot
AI
Aug 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace Console.WriteLine with proper logging using ILogger. Console output may not be visible in production WPF applications and doesn't follow the project's logging patterns.
| Console.WriteLine($"Temporary video file deleted successfully: {_tempVideoPath}"); | |
| } | |
| catch (Exception ex) | |
| { | |
| Console.WriteLine($"Could not delete temporary video file: {_tempVideoPath}. Error: {ex.Message}"); | |
| _logger.LogInformation("Temporary video file deleted successfully: {TempVideoPath}", _tempVideoPath); | |
| } | |
| catch (Exception ex) | |
| { | |
| _logger.LogError(ex, "Could not delete temporary video file: {TempVideoPath}", _tempVideoPath); |
|
|
||
| private readonly ILogger<CameraService> _logger; | ||
|
|
||
| public Action<BitmapSource>? OnFrameReady { get; set; } |
Copilot
AI
Aug 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider using an event instead of an Action property for better encapsulation and thread safety. This would prevent external code from setting the callback to null accidentally.
| public Action<BitmapSource>? OnFrameReady { get; set; } | |
| public event Action<BitmapSource>? OnFrameReady; |
| IsTextSearchEnabled="True" | ||
| ItemsSource="{Binding DataContext.Categories, RelativeSource={RelativeSource AncestorType=UserControl}}" | ||
| Text="{Binding Category, UpdateSourceTrigger=PropertyChanged}" | ||
| ItemsSource="{Binding DataContext.CategoriesForForm, RelativeSource={RelativeSource AncestorType=UserControl}}" Text="{Binding Category, UpdateSourceTrigger=PropertyChanged}" |
Copilot
AI
Aug 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The line appears to be missing proper formatting with the Text binding on the same line as ItemsSource. This should be split into separate lines for better readability.
| ItemsSource="{Binding DataContext.CategoriesForForm, RelativeSource={RelativeSource AncestorType=UserControl}}" Text="{Binding Category, UpdateSourceTrigger=PropertyChanged}" | |
| ItemsSource="{Binding DataContext.CategoriesForForm, RelativeSource={RelativeSource AncestorType=UserControl}}" | |
| Text="{Binding Category, UpdateSourceTrigger=PropertyChanged}" |
| CommandParameter="{Binding}"> | ||
| <Image Source="/Assets/Images/Icons/edit.png" Width="16" Height="16"/> | ||
| </Button> | ||
| CommandParameter="{Binding}"/> |
Copilot
AI
Aug 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The edit button is missing its Image child element, which would make it invisible to users. Compare with the pattern used in other buttons in the same file.
| CommandParameter="{Binding}"/> | |
| CommandParameter="{Binding}"> | |
| <Image Source="/Assets/Icons/edit.png" Width="20" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center"/> | |
| </Button> |
| CommandParameter="{Binding}"> | ||
| <Image Source="/Assets/Images/Icons/delete.png" Width="16" Height="16"/> | ||
| </Button> | ||
| CommandParameter="{Binding}"/> |
Copilot
AI
Aug 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The delete button is missing its Image child element, which would make it invisible to users. Compare with the pattern used in other buttons in the same file.
| CommandParameter="{Binding}"/> | |
| CommandParameter="{Binding}"> | |
| <Image Source="/Assets/Icons/delete.png" Width="16" Height="16" Stretch="Uniform"/> | |
| </Button> |
This pull request introduces several new features and improvements related to debt management and video handling in the application. The main highlights are the addition of camera/video recording capabilities, enhancements to the debt model for supporting video evidence, and new API integrations for video streaming and marking debts as defaulted. There are also supporting updates in dependency management and UI logic.
New Features: Camera and Video Support
CameraServiceimplementingICameraServicefor capturing and recording videos using the user's camera, leveraging Emgu.CV and WPF integration. This includes frame capture, video recording, and resource management. (FinTrack/Services/Camera/CameraService.cs,FinTrack/Services/Camera/ICameraService.cs,FinTrack/App.xaml.cs) [1] [2] [3] [4]CameraServicein the application's dependency injection container.Debt Model and Business Logic Enhancements
DebtDtoandDebtModelto include theVideoMetadataIdproperty, enabling association of debts with video evidence. (FinTrack/Dtos/DebtDtos/DebtDto.cs,FinTrack/Models/Debt/DebtModel.cs,FinTrack/Services/Debts/DebtStore.cs) [1] [2] [3]DebtModelfor controlling the visibility of UI actions such as "Watch Collateral Video" and "Mark as Defaulted," based on debt status, user role, and due date. (FinTrack/Models/Debt/DebtModel.cs) [1] [2] [3]API and Service Integrations
ApiServiceandDebtStorefor streaming video files and marking debts as defaulted via API, including interface updates. (FinTrack/Services/Api/ApiService.cs,FinTrack/Services/Api/IApiService.cs,FinTrack/Services/Debts/DebtStore.cs,FinTrack/Services/Debts/IDebtStore.cs) [1] [2] [3] [4]FinTrack/Services/Api/ApiService.cs,FinTrack/Services/AuthService.cs) [1] [2]Dependency and Infrastructure Updates
Emgu.CV.Bitmap,Emgu.CV.runtime.windows), UI enhancements (ReactiveUI.WPF), and image handling (System.Drawing.Common). (FinTrack/FinTrackForWindows.csproj) [1] [2]UI and Status Improvements
DebtModelfor better visual distinction and updated status text for the "Defaulted" state. (FinTrack/Models/Debt/DebtModel.cs) [1] [2]Let me know if you want to see how to use the new camera or video features in the UI, or if you need details about the API changes!